<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'workflow.label', default: 'workflow')}"/>
    <title>工作流</title>
</head>

<body>
    <div class="main-body">
        <div class="page-wrapper">
            <div class="page-header">
                <div class="page-header-title">
                    <h4>工作流详情</h4>
                </div>
                <div class="page-header-breadcrumb">
                    <ul class="breadcrumb-title">
                        <li class="breadcrumb-item">
                            <a href="/salesDashboard/index">
                                <i class="icofont icofont-home"></i>
                            </a>
                        </li>
                        <li class="breadcrumb-item">
                            <g:link controller="workflow" action="index">工作流列表</g:link>
                        </li>
                        <li class="breadcrumb-item">工作流详情</li>
                    </ul>
                </div>
            </div>

            <div class="page-body">
                <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">×</span></button>
                    </div>
                </g:if>
                <div class="card">
                    <div class="card-header">
                        <h5>工作流详情</h5>

                        <div class="card-header-right">
                            
                            <g:link action="edit" resource="${this.workflow}" data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑">
                            <i class="icofont icofont-edit"></i>
                        </g:link>
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>
                <div class="card-block">

                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">名称</label>

                        <div class="col-md-3">
                            <div class="form-control-static">${this.workflow?.name}</div>
                        </div>
                        <label class="col-md-2 col-form-label">是否启用</label>

                        <div class="col-md-3">
                            <div class="form-control-static">${this.workflow?.active}</div>
                        </div>
                    </div>

                </div>


            </div>
            <div class="card">
                <div class="card-header">
                    <h5>工作流阶段</h5>

                    <div class="card-header-right">
                        <g:link controller="workflowStage" action="create" params="[workflow: this.workflow?.id]" data-toggle="tooltip" data-placement="top" title="" data-original-title="新增">
                        <i class="icofont icofont-plus"></i>
                    </g:link>
                    <i class="icofont icofont-rounded-down"></i>
                    
                </div>
            </div>
            <div class="card-block dt-responsive">

                <div class="table-responsive">
                    <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">

                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                                <tr>
                                  <g:sortableColumn property="executionSequence"
                                  title="${message(code: 'workflowStage.executionSequence.label', default: '执行次序')}"/>
                                  <g:sortableColumn property="name"
                                  title="${message(code: 'workflowStage.executionSequence.label', default: '名称')}"/>
                                  <g:sortableColumn property="canReject"
                                  title="${message(code: 'workflowStage.canReject.label', default: '能否回退')}"/>
                                  <g:sortableColumn class="text-center" width="8%" property="operation"
                                  title="${message(code: 'workflowStage.operation.label', default: '操作')}"/>
                              </tr>
                          </thead>
                          <tbody>
                            <g:each in="${this.workflowStages}">
                            <tr>
                              <td>
                                <g:link controller="workflowStage" action="show"
                                id="${it?.id}">${it?.executionSequence}</g:link>
                            </td>
                            <td>
                                ${it?.name}
                            </td>
                            <td>${it?.canReject}</td>
                            <td class="text-center">
                            <g:link class="m-r-15 text-primary"
                                        controller="workflowStage" action="edit"
                                        id="${it?.id}">
                                        <i class="icofont icofont-ui-edit"></i>
                                    </g:link>
                                <g:form resource="${it}" class="inline" method="DELETE">
                                                <button class="deleteBtn text-danger" type="button">
                                                    <i class="icofont icofont-trash"></i>
                                                </button>
                                            </g:form>

                        </td>
                    </tr>
                </g:each>
            </tbody>
        </table>
    </div>
</div>

</div>
</div>

</div>
</div>
</div>

</body>
</html>
